export default {
  state: {
    // 应用名称
    appName: 'Magic-Code',
    // 主题颜色
    themeColor: '#15282A',
    // 上一次主题颜色
    oldThemeColor: '#15282A',
    // 导航栏收缩状态
    collapse: false,
    // 菜单和路由是否已经加载
    menuRouteLoaded: false
  },
  getters: {
    // 对应着上面state
    collapse (state) {
      return state.collapse
    }
  },
  mutations: {
    // 改变收缩状态
    onCollapse (state) {
      state.collapse = !state.collapse
    },
    // 改变主题颜色
    setThemeColor (state, themeColor) {
      state.oldThemeColor = state.themeColor
      state.themeColor = themeColor
    },
    // 改变菜单和路由的加载状态
    menuRouteLoaded (state, menuRouteLoaded) {
      state.menuRouteLoaded = menuRouteLoaded
    }
  },
  actions: {}
}
